#pragma once
#include "Link.h"
#include "Observer.h"
#include <vector>
#include <iostream>
#include "Subject.h"
#include "Visitor.h"

using namespace std;

class Arm : public Subject
{
private:
	
	Link lFirst,lSecond;
	double aFirst,aSecond;

public:
	Arm(Point & pStart,int lDistance1,int lDistance2,double a,double b):
	  lFirst(pStart,Point(0,0),lDistance1),
	  lSecond(Point(0,0),Point(0,0),lDistance2),
	  aFirst(a),aSecond(b)
	  {}

	 void setAngleFirst (double a) ;
	 void setAngleSecond(double a) ;
	 void modifyAngleFirst (double a) ;
	 void modifyAngleSecond(double a) ;
	 void calculate();

	 double getAngleFirst()  {return aFirst;}
	 double getAngleSecond() {return aSecond;}

	 Link & getLinkFirst() { return lFirst;}
	 Link & getLinkSecond() { return lSecond;}

	 void Accept(Visitor *v);

	 friend ostream & operator<<(ostream & os,Arm & a)
	 {
	    os<<a.getLinkFirst();
    	os<<a.getLinkSecond();

	    os<<a.getAngleFirst()<<endl;
		os<<a.getAngleSecond()<<endl;
		return os;
	  }
	
};
